package org.happy.tester.app.web;

import org.happy.tester.app.User;
import org.happy.tester.app.service.UserService;
import org.happy.tester.common.http.resp.BaseResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/app")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/get")
    public BaseResponse<Object> getUser() {
        System.out.println(System.getProperty("java.home"));
        User user = userService.getUser();
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setData(user);
        return baseResponse.success();
    }
}
